{% extends 'analysis_plugins/general_information.html' %}


{% block analysis_result_details %}

    {% set analysis = firmware.processed_analysis[selected_analysis] %}

    {% if 'files' in analysis %}
        <tr>
            <th class="success" colspan="2">
                Results for Included Files
            </th>
        </tr>
        {% for file in analysis['files'] %}
            <tr>
                <td>{{ analysis['files'][file]['file path'] }}</td>
                <td  style="padding: 0;">
                    <table class="table table-bordered" style="margin-bottom: 0;">
                        {% for key in analysis['files'][file] | sort %}
                            {% if key != 'file path' %}
                            <tr>
                                <td>{{ key }}</td>
                                <td>
                                    {% if 'time' in key %}
                                        {{ analysis['files'][file][key] | nice_unix_time | safe }}
                                    {% else %}
                                        {{ analysis['files'][file][key] | safe }}
                                    {% endif %}
                                </td>
                            </tr>
                            {% endif %}
                        {% endfor %}
                    </table>
                </td>
            </tr>
        {% endfor %}
    {% endif %}

{% endblock %}


{% block ajax %}
    {% set analysis = firmware.processed_analysis[selected_analysis] %}

    {% if 'contained_in_file_system' in analysis and analysis.contained_in_file_system == True %}
        <div id="file_results"></div>
        <script>
            $(document).ready(function() {
                $('#file_results').load('/plugins/file_system_metadata/ajax/{{ firmware.uid }}');
            });
        </script>
    {% endif %}

{% endblock %}